// 第一种写法
let info = function(name:string,age:number):string | number{
    return 3
}

info('zhang',15)


// 第二种写法
// let info2:(name: string,age: number) => number = function(name:string, age:number){
    let info2:(name: string,age: number) => number = function(name, age){
    console.log("name",name,"age",age);
    return 4
}
info2('wangwu',11)

type TypStuobj = {  username: string, age:number,phone: string}
// 函数解构
let stuObj2: TypStuobj = { username:'wangwu',age:23,phone:'111' }
function subInfo({username,age}:TypStuobj){
    console.log("name",username,"age",age);
    return 3
}
subInfo({username:'lisi',age:23,phone:"111"})
export {}